<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>核力教育</title>
    <meta name="Keywords" content="核力教育"/>
    <meta name="description" content="核力教育"/>
    <meta content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport">
    <meta content="no-cache,must-revalidate" http-equiv="Cache-Control">
    <meta content="no-cache" http-equiv="pragma">
    <meta content="0" http-equiv="expires">
    <meta content="telephone=no, address=no" name="format-detection">
    <meta name="apple-mobile-web-app-capable" content="no"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
    <!--[if lte IE 8]>
    <script>window.location.href = 'http://support.dmeng.net/upgrade-your-browser.html?referrer=' + encodeURIComponent(window.location.href);</script>
    <![endif]-->
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/overyears.css">
    <link rel="stylesheet" href="plugins/layerUI/src/css/layui.css">
</head>
<body onload="listTabEvent(1)">
<div class="container">
    <div class="headerBg"></div>
    <div class="contents">
        <div class="tabWrap clearfix">
            <div class="logoWrap" style="background-image:url('images/logo.png')"></div>
            <div class="tabListWrap"></div>
            <!--<div class="tabTextWrap">-->
            <!--<div class="tabTextIcon"></div>-->
            <!--<div class="tabTextInput">-->
            <!--<input type="text" placeholder="当前一个练习进行中..." disabled="disabled">-->
            <!--</div>-->
            <!--<div class="tabTextBut">-->
            <!--<button>继续</button>-->
            <!--</div>-->
            <!--</div>-->
        </div>
        <div class="mainWrap clearfix">
            <div class="mainLeft">
                <div class="personsWrap">
                    <div class="personHeadWrap">
                        <div class="personHead" style="background-image:url('images/use.png')"></div>
                    </div>
                    <div class="personListWrap clearfix">
                        <!--<div class="personList"><i-->
                        <!--style="background-image:url('images/kecheng.png')"></i><span>我的课程</span></div>-->
                        <!--<div class="personList"><i-->
                        <!--style="background-image:url('images/zuopin.png')"></i><span>我的作品</span></div>-->
                        <!--<div class="personList"><i-->
                        <!--style="background-image:url('images/geren.png')"></i><span>个人设置</span></div>-->
                        <!--<div class="personList loginOutBut"><i-->
                        <!--style="background-image:url('images/tuichu.png')"></i><span>退出登录</span></div>-->
                        <div class="personList"><i style="background-image:url('images/kecheng.png')"></i><span style="color:#666;">我的课程<small>(待开放)</small></span></div>
                        <div class="personList"><i style="background-image:url('images/zuopin.png')"></i><span style="color:#666;">我的作品<small>(待开放)</small></span></div>
                        <div class="personList"><i style="background-image:url('images/geren.png')"></i><span style="color:#666;">个人设置<small>(待开放)</small></span></div>
                        <div class="personList loginOutBut"><i style="background-image:url('images/tuichu.png')"></i><span>退出登录</span></div>
                    </div>
                </div>
                <div class="dateWrap">
                    <div class="dateDayWrap clearfix">
                        <div class="dateDayList">
                            <div class="dateDay on" data-day="0" style="background-image:url('images/3.png')"></div>
                        </div>
                        <div class="dateDayList">
                            <div class="dateDay on" data-day="0" style="background-image:url('images/1.png')"></div>
                        </div>
                        <div class="dateDayList">
                            <div class="dateDay on" data-day="0" style="background-image:url('images/6.png')"></div>
                        </div>
                        <div class="dateDayList">
                            <div class="dateTime">天</div>
                        </div>
                    </div>
                    <div class="dateTxt">距离2019 NOIP 初赛</div>
                </div>
                <div class="echartWrap clearfix">
                    <!--<h2>近期答题成功率</h2>-->
                    <h2><span style="color:#999;">近期答题成功率(待开放)</span></h2>
                    <div id="main" style="width:236px;height:236px;"></div>
                </div>
            </div>
            <div class="mainRight">
                <!--<div class="subjectList">-->
                <!--<div class="subjectHover">-->
                <!--<div class="subjectEditorBut"></div>-->
                <!--<h2>NOIP2018NOIP</h2>-->
                <!--<h2>模拟考试</h2>-->
                <!--<div class="subjectGrade"><i></i><span>难度等级</span></div>-->
                <!--<div class="subjectStar" data-index="1">-->
                <!--<ul>-->
                <!--<li class="on"></li>-->
                <!--<li></li>-->
                <!--<li></li>-->
                <!--<li></li>-->
                <!--<li></li>-->
                <!--</ul>-->
                <!--</div>-->
                <!--<div class="subjectToggle">-->
                <!--<button>开始做题</button>-->
                <!--</div>-->
                <!--</div>-->
                <!--</div>-->
            </div>
        </div>
    </div>
</div>
<script src="plugins/jquery/jquery-1.11.1.min.js"></script>
<script src="plugins/cookie/jquery.cookie.js"></script>
<script src="plugins/echarts/echarts.simple.min.js"></script>
<script src="js/config.js"></script>
<script src="js/public.js"></script>
<script src="plugins/layerUI/src/layui.js"></script>
<script type="text/javascript">
    //subjectList点击
    var subjectListEvent=function(){
        $(".subjectList").unbind('click').click(function(){
            var statusArr={
                'auth_token':tokens,
                'group_id':$(this).attr('data-id'),
                'group_type':1,
                'mode':2,
                'history_id':0
            };
            $.cookie('statusArr',JSON.stringify(statusArr));
            $.cookie('statusArrBool',false);
        });
    };

    //请求课程分类列表数据
    var topicList=function(token){
        var arr1={
            auth_token:token,
            page_no:1,
            page_size:18
        };
        $.ajax({
            type: "GET",
            url:base_url + "tp/list",
            data:arr1,
            beforeSend:function(XMLHttpRequest){

            },
            success:function(data){
                console.log(data);
                var datas=data.data;
                if(datas){
                    var page_contents=datas.page_contents;
                    for(var i=0;i<page_contents.length;i++){
                        var group_desc=page_contents[i].group_desc;
                        var group_id=page_contents[i].group_id;
                        var group_type=page_contents[i].group_type;

                        var li='<div class="subjectList" data-id="'+group_id+'">\n' +
                            '          <a href="overyears/list.html">\n' +
                            '                    <div class="subjectHover">\n' +
                            '                        <div class="subjectEditorBut"></div>\n' +
                            '                        <h2>'+group_desc+'</h2>\n' +
                            '                        <h2 class="on">'+group_type+'</h2>\n' +
                            // '                        <div class="subjectGrade"><i></i><span>难度等级</span></div>\n' +
                            '                        <div class="subjectStar">\n' +
                            '                            <ul>\n' +
                            '                                <li></li>\n' +
                            '                                <li></li>\n' +
                            '                                <li></li>\n' +
                            '                                <li></li>\n' +
                            '                                <li></li>\n' +
                            '                            </ul>\n' +
                            '                        </div>\n' +
                            '                        <div class="subjectToggle">\n' +
                            '                            <button>开始做题</button>\n' +
                            '                        </div>\n' +
                            '                    </div>\n' +
                            '                    </a>\n' +
                            '                </div>';
                        $(".mainRight").append(li);
                    }
                    subjectListEvent();
                }
            },
            error:function(){
                console.log('失败')
            }

        });
    };
    $(function(){
        console.log(tokens);
        //判断token
        if(tokens){
            topicList(tokens);
        }else{
            layTxt('您还没登录!');
            setTimeout(function(){
                setUrl('overyears','login')//设置跳转
            },1000)
        }

        //星级悬停效果
        $(".subjectStar ul li").hover(function(){
            var indexs=($(this).index())+1;
            for(var i=0; i<indexs;i++){
                $(this).parents('.subjectStar').find("ul li").eq(i).addClass('on')
            }
        },function(){
            var parentObj=$(this).parents('.subjectStar');
            var ObjSpot=parentObj.attr('data-index');
            parentObj.find("ul li").removeClass('on');
            for(var i=0; i<ObjSpot;i++){
                parentObj.find("ul li").eq(i).addClass('on')
            }
        });
    });


    //echarts
    var echartData={
        "dataX":['0', '1', '2', '3', '4', '5', '6'],
        "dataY":[820, 932, 901, 934, 1290, 1330, 1320]
    };
    echartEvent(echartData)

</script>
</body>
</html>